﻿using System.Collections;
using System.Collections.Generic;

namespace Rimifier.Support.ZoneManager
{
  public class ZoneList : IList<Zone>
  {

    private readonly List<Zone> _innerList = new List<Zone>();

    #region Implementation of IEnumerable
    IEnumerator<Zone> IEnumerable<Zone>.GetEnumerator()
    {
      return _innerList.GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
      return _innerList.GetEnumerator();
    }
    #endregion

    #region Implementation of ICollection<T>
    public void Add(Zone item)
    {
      _innerList.Add(item);
    }

    public void Clear()
    {
      _innerList.Clear();
    }

    public bool Contains(Zone item)
    {
      return _innerList.Contains(item);
    }

    public void CopyTo(Zone[] array, int arrayIndex)
    {
      _innerList.CopyTo(array, arrayIndex);
    }

    public bool Remove(Zone item)
    {
      return _innerList.Remove(item);
    }

    public int Count
    {
      get { return _innerList.Count; }
    }

    public bool IsReadOnly
    {
      get { return false; }
    }
    #endregion

    #region Implementation of IList<T>

    public int IndexOf(Zone item)
    {
      return _innerList.IndexOf(item);
    }

    public void Insert(int index, Zone item)
    {
      _innerList.Insert(index, item);
    }

    public void RemoveAt(int index)
    {
      _innerList.RemoveAt(index);
    }

    public Zone this[int index]
    {
      get { return _innerList[index]; }
      set { _innerList[index] = value; }
    }

    #endregion

  }
}
